#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QStack>
#include <QString>
#include <QChar>
#include <cmath>
#include <stdexcept>
namespace Ui {
class Widget;
}

class Widget : public QWidget
{
    Q_OBJECT

public:
    explicit Widget(QWidget *parent = 0);
    ~Widget();
public:

    double evaluateExpression(const QString &expression);
    void performOperation(QStack<double> &numbers, QStack<QChar> &operations);
    int precedence(QChar op);
private slots:
    void on_pushButton_0_clicked();

    void on_pushButton_1_clicked();


    void on_pushButton_29_clicked();

    void on_pushButton_30_clicked();

    void on_pushButton_21_clicked();

    void on_pushButton_22_clicked();

    void on_pushButton_23_clicked();

    void on_pushButton_24_clicked();

    void on_pushButton_25_clicked();

    void on_pushButton_26_clicked();

    void on_pushButton_add_clicked();

    void on_pushButton_sub_clicked();

    void on_pushButton_mul_clicked();

    void on_pushButton_div_clicked();

    void on_pushButton_eq_clicked();

    void on_pushButton_delAll_clicked();

    void on_pushButton_del_clicked();

private:
    Ui::Widget *ui;
};

#endif // WIDGET_H
